<%@ page contentType="application/json" isELIgnored="false" %> 
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
{"events": [
<c:forEach items="${events}" var="event" varStatus="status">
	<c:if test="${status.index > 0}">,</c:if>
	{"type": "${event.class.simpleName}", "entityId": "${event.subject.id}"
	<c:choose>
		<c:when test="${event.class.simpleName == 'MoveEvent'}">
			, "x": ${event.direction.x * event.distance}, "y": ${event.direction.y * event.distance}
		</c:when>
		<c:when test="${event.class.simpleName == 'ActionPointsEvent'}">
			, "actionPointsRemaining": ${event.actionPointsRemaining}
		</c:when>
		<c:when test="${event.class.simpleName == 'HitEvent'}">
			, "targetId": "${event.target.id}", "damage": ${event.damage}
		</c:when>
		<c:when test="${event.class.simpleName == 'MissEvent'}">
			, "targetId": "${event.target.id}"
		</c:when>
	</c:choose>
	}
</c:forEach>
]}